<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>地图</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui/aui.css" />
    <style>

    </style>
</head>

<body>
    <div id="app">

    </div>
</body>
<script src="../../../script/api.js" charset="utf-8"></script>
<script src="../../../script/common/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="../../../script/common/common.js" charset="utf-8"></script>
<script src="../../../script/common/config.js" charset="utf-8"></script>
<script src="../../../script/common/vue.min.js" charset="utf-8"></script>
<script>
    apiready = function() {
        api.parseTapmode();
        openMap();
    }

    function openMap() {
        var aMap = api.require('aMap');
        aMap.open({
            rect: {
                x: 0,
                y: 0,
                w: '100vw',
                h: '100vh'
            },
            showUserLocation: true,
            zoomLevel: 14,
            center: {
                lon: 112.550773,
                lat: 37.807095
            },
            fixedOn: api.frameName,
            fixed: true
        }, function(ret, err) {
            if (ret.status) {
                aMap.addAnnotations({
                    annotations: [{
                        id: 1,
                        lon: 112.550773,
                        lat: 37.807095
                    }],
                    icons: ['widget://image/icon/daohang.png'],
                    draggable: true,
                    timeInterval: 2.0
                }, function(ret) {
                    if (ret.eventType == 'click') {
                      api.openApp({
                          androidPkg: 'android.intent.action.VIEW',
                          appParam: {
                              origin: '平阳路学府街口',
                              destination: '小店区',
                              region: '山西',
                              mode: 'driving',
                              src: api.appName
                          },
                          // uri: 'intent://map/direction?origin=平阳路学府街口&destination=小店区&mode=driving&region=山西&src=osm#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end',
                          uri: 'https://uri.amap.com/marker?position=112.550773,37.807095',
                          iosUrl: 'baidumap://map/direction'
                      }, function(ret, err) {});
                    }
                });
            } else {}
        });
    }
</script>

</html>
